<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <script>
  	function uploaded(path){
		$("#img_url").attr("src",'__PUBLIC__'+path);
		$("input[name='img_url']").val(path);
	}
	
	function del_img(){
		if(confirm('您确定要删除图片吗?')){
			var file=$("input[name='img_url']").val();
			$.post("{:U('delImgBypath')}",{'path':file},function(data){
				$("input[name='img_url']").val('');
				$("#img_url").attr('src','');
			});
		}else{
			return false;
		}
	}
	//删除图组图片
	function mdel_img(path){
		$('#img_list div img').each(function(index, element) {
			$.post("{:U('delImgBypath')}",{'path':path},function(data){
				if(data=='OK'){
					
					$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove();
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
				}
			});
		});
	}
  </script>
  
  
  <style>
  	.modulesList li{float:left; margin-left:10px;}
	.modulesList li p{text-align:center;}
  </style>
  <h1><a href="{:U('index')}">返回列表</a></h1>
    
      <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="2">
            <ul class="modulesList"><volist name="modulesList" id="vo">
                
            	<li><form class="checkoutform" action="{:U('insert')}" method="post">
                <input type="hidden" value="{$vo.title}" name="title" />
                <input type="hidden" value="{$vo.img_url}" name="img_url" />
                <input type="hidden" value="{$templatefilename}" name="templatefilename" />
                 <input type="hidden" value="{$vo.filename}" name="filename" />
                 <input type="hidden" value="{$vo.type}" name="type" />
                 <input type="hidden" value="0 auto 0 auto" name="margin" />
                 <notempty name="pid">
                 <input type="hidden" value="{$pid}" name="pid" /></notempty>
                <a href="javascript:;" onclick="$(this).parent().submit();"><img width="100" height="100" src="{:getThumbPath($vo['img_url'])}" /></a>
                <p>{$vo.title}</p></form>
                </li>
                </volist>
            </ul>
        </td>
      </tr>
      </table>
    
  </div>
  <div class="clear"></div>
</div>
</body></html>